﻿using FluentNHibernate.Conventions;

namespace good1.Data.NHibernateMaps.Conventions
{
    public class PrimaryKeyConvention : IIdConvention
    {
        #region IConvention<IIdentityInspector,IIdentityInstance> Members
        public void Apply(FluentNHibernate.Conventions.Instances.IIdentityInstance instance)
        {
            instance.Column("Id");//others use instance.EntityType.Name as prefix, simply a matter of taste, not hard to change bar the data migration ;)
            instance.UnsavedValue("0");
            instance.GeneratedBy.Identity();
        }
        #endregion
    }
}
